﻿<?php
require_once("../../config.php");
global $conf;

$con = mysql_connect($conf['db_host'], $conf['db_user'], $conf['db_pass']);
mysql_select_db($conf['db_name']);	
mysql_query('SET NAMES UTF8');

$sqlSelect = "SELECT tieude, cuphap FROM tbl_biquyet";
$query=mysql_query($sqlSelect);

$data = array();
if(mysql_num_rows($query) > 0)
{	
	while($row=mysql_fetch_array($query))	
	{
		 $data['biquyet'][] = array('ten' => $row['tieude'], 'cuphap' => $row['cuphap']);
	}
}else{
	$data['error'] = 1;
}
//$id = $_GET['id'];
echo json_encode($data);

mysql_close($con);

?>
